﻿// -----------------------------------------------------------------------
// <copyright file="IGetCountQuery.cs">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace Moveax.DataAccess.Cqrs.Highway.UnitTests.Model.Queries
{
	using System.Diagnostics.Contracts;

	[ContractClass(typeof(GetCountQueryContract))]
	public interface IGetCountQuery : IQuery
	{
		int Execute<TEntity>()
			where TEntity : class;
	}

	[ContractClassFor(typeof(IGetCountQuery))]
	internal abstract class GetCountQueryContract : IGetCountQuery
	{
		public int Execute<TEntity>()
			where TEntity : class
		{
			Contract.Ensures(0 <= Contract.Result<int>());

			return default(int);
		}
	}
}
